fix(ui): enumerate codebase-memory-mcp processes on Windows#955
fix(ui): enumerate codebase-memory-mcp processes on Windows#955EightDoor wants to merge 1 commit into
Conversation
Windows handle_processes previously returned an empty processes array
because it only queried the current process via GetProcessMemoryInfo/
GetProcessTimes. POSIX uses popen("ps") to enumerate all instances.
Add process enumeration via CreateToolhelp32Snapshot + Process32First/
Process32Next to find all codebase-memory-mcp.exe processes, query per-
process CPU/memory/elapsed time via OpenProcess + GetProcessTimes +
GetProcessMemoryInfo, and return them in the JSON response.
Closes DeusData#50
|
Thanks for taking the Windows UI process-list gap. Triage: Windows local-UI bug for #950, normal priority. Review focus is access-denied handling, stable JSON shape, and avoiding exposure of more process detail than the UI needs. |
|
The fix itself looks right — One blocker: DCO fails — the commit is missing its |
Problem
On Windows, the Control Panel's Active Processes tab always shows empty because
handle_processesinsrc/ui/http_server.conly queries the current process viaGetProcessMemoryInfo/GetProcessTimesand returns"processes":[]. The POSIX path usespopen("ps")to enumerate allcodebase-memory-mcpinstances.Closes #50
Solution
Added Windows process enumeration via
CreateToolhelp32Snapshot+Process32First/Process32Nextto find allcodebase-memory-mcp.exeinstances. For each matching process:OpenProcesswithPROCESS_QUERY_INFORMATION | PROCESS_VM_READGetProcessTimes(user + system)GetProcessMemoryInfo(WorkingSetSize)is_selfflagChanges
src/ui/http_server.c: Added#include <tlhelp32.h>and ~70 lines of process enumeration logicEdge Cases Handled
OpenProcessfailure (skips process)GetProcessMemoryInfo/GetProcessTimesfailure (zeros fallback)CreateToolhelp32Snapshotfailure (returns empty array)Test Plan
build-windows/build-windows-arm64jobs compile successfullycodebase-memory-mcpinstances, verify Active Processes tab shows all instances with CPU/memory/elapsed values